package com.yc.store.biz;

import com.yc.store.bean.User;
import com.yc.store.mapper.UserMapper;
import com.yc.store.util.Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginBiz {

    @Autowired
    UserMapper userMapper;

    public User login(User user) throws BizExeption {
        Utils.check(Utils.isEmpty(user.getName()),"请输入要登录的用户名称!");
        Utils.check(Utils.isEmpty(user.getPwd()),"请输入要登录的用户密码!");

        return userMapper.login(user);
    }
}
